package com.corpgovernment.common.enums;

import java.util.Arrays;

public enum VipStatusEnum {
    /**
     * vip订单
     */
    VIP("vip订单", "T"),

    /**
     * 其他
     */
    OTHER("其它", "F");

    /**
     * 名称
     */
    private String name;

    /**
     * 类型
     */
    private String type;

    VipStatusEnum(String name, String type) {
        this.name = name;
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public static VipStatusEnum getByType(String type) {
        return Arrays.stream(VipStatusEnum.values()).filter(e -> e.getType().equals(type)).findFirst().orElse(null);
    }
}
